package com.lzhan.day16.TCPSOCKET;

import java.io.IOException;
import java.io.PrintStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {

	public static void main(String[] args) {
		ServerSocket server=null;
		try {
		    server=new ServerSocket(60000);
			while(true){
				Socket s=server.accept();
				PrintStream printer=new PrintStream(s.getOutputStream());
				printer.print("i am come from server *****");
				printer.close();
				s.close();
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			if(server!=null){
				try {
					server.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
	}

}
